package org.learn.test;

public class TernaryOperatorExercise {
    public static void main (String[]args){
        //实现三个数的最大值
        int n1 = 515;
        int n2 = 33;
        int n3 = 123;
        //先得到n1，n2最大数，保存到max1，
        //max1和n3比较
        int max1 =n1 > n2 ? n1 : n2;
        int max = max1 > n3 ? max1 : n3;
        System.out.println("三个数中最大的是" + max);

    }
}
